//
//  FPTopListViewCell.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/14.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPTopListViewCell.h"

@implementation FPTopListViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.listLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, kScreenWidth, 0)];
        self.listLabel.numberOfLines = 0;
        [self.contentView addSubview:_listLabel];
    }
    return self;
}

- (void)adjustSubviewsWithContent:(FPTopModel *)model
{

    self.listLabel.text = model.topListNameCn;
    CGRect bounds = [model.topListNameCn boundingRectWithSize:CGSizeMake(kScreenWidth , 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:16] forKey:NSFontAttributeName] context:nil];
    self.listLabel.font = [UIFont systemFontOfSize:16];
    CGRect frame = self.listLabel.frame;
    frame.size.height = bounds.size.height;
    self.listLabel.frame = frame;
   

}


+ (CGFloat)heightForCell:(FPTopModel *)model
{
    CGRect bounds = [model.topListNameCn boundingRectWithSize:CGSizeMake(kScreenWidth, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:16] forKey:NSFontAttributeName] context:nil];
    return bounds.size.height+20;
}



@end
